package lab02.test19;

/**
 * Created by 阿阿阿阿豪丶 on 2017/10/27.
 */
public class Test {
    public static void main(String args[]) {
        StringBuffer str = new StringBuffer("HelloWorld");
        StringBuffer str1 = new StringBuffer();
        StringBuffer str2 = new StringBuffer();

        str1 = str.reverse();
        String str3 = str1.toString();

        for (int i = 0; i < str1.length(); i++) {
            char temp = str1.charAt(i);
            if (temp >= 'A' && temp <= 'Z') {
                str2.append((char) (temp + 32));
            } else if (temp >= 'a' && temp <= 'z') {
                str2.append((char) (temp - 32));
            }
        }
        System.out.println(str2.toString());
    }
}

